import * as searchRes from '@/api/search-res';

export default {
  namespaced: true,
  state: {
    resultList: {},
  },
  mutations: {
    // 搜索结果
    setResultList(state, newValue) {
      state.resultList = newValue;
    },
  },
  actions: {
    // 搜索结果
    async updateResultList(ctx, value) {
      const res = await searchRes.getResultList(value);
      ctx.commit('setResultList', res);
    },
  }
}